#ifndef SERVEREXPLORERIMPL_H
#define SERVEREXPLORERIMPL_H

#include <QtGui/QDialog>
#include <QTcpSocket>
#include "serverinfo.h"

namespace Ui {
    class ServerExplorerImpl;
}

class ServerExplorerImpl : public QDialog {
    Q_OBJECT
    Q_DISABLE_COPY(ServerExplorerImpl)
public:
    explicit ServerExplorerImpl(QWidget *parent = 0);
    virtual ~ServerExplorerImpl();

protected:
    virtual void changeEvent(QEvent *e);

private:
    Ui::ServerExplorerImpl *m_ui;
    ServerInfo *serverInfo_ui;
    QTcpSocket * tcpSocket;
    int serverInfoPort_;
    QString NickName;

public slots:
    void ConnectToServer();
    void ReadFromServer();
    void ServerConnected();
    void displayError(QAbstractSocket::SocketError socketError);
    void ShowServerInfo();
    void SetNickName();
    void SendNickName();

public:
    void ParseXML(QString xmlstring);
    bool Get(QString &string, QString &source, QString NodeName);
};

#endif // SERVEREXPLORERIMPL_H
